package com.it.mybatis.spring.sqlSession;

import java.lang.reflect.InvocationTargetException;
import java.sql.SQLException;
import java.util.List;

/**
 * @author 胡凯
 * @create 2021/11/25 17:41
 * 定义数据库操作，目前只定义了查询
 */
public interface SqlSession {
    <T> T selectOne(String statement) throws SQLException, ClassNotFoundException, InvocationTargetException, NoSuchMethodException, InstantiationException, IllegalAccessException;
    <T> T selectOne(String statement, Object parameter) throws SQLException;
    <T> List<T> selectList(String statement) throws SQLException, ClassNotFoundException, InvocationTargetException, NoSuchMethodException, InstantiationException, IllegalAccessException;

    <T> List<T> selectList(String statement, Object parameter);

    void close();
}
